package com.atguigu.gulimall.ware.dao;

import com.atguigu.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-11-01 20:10:23
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    Long selectBySkuIds(Long skuId);

    List<Long> selectWareHasStock(@Param("skuId") Long skuId);

    int updateWareStock(@Param("skuId") Long skuId, @Param("num") Integer num, @Param("wareId") Long wareId);

    void unStockLock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);
}
